﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master"
    CodeBehind="MedidaList.aspx.cs" Inherits="ELoje_web.MedidaList" %>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content">
        <div id="siteMap">
            <div style="float: left;">
                <asp:Label ID="lblHistoryNavigation" runat="server"></asp:Label>
                <asp:Label ID="lblThisPage" runat="server"></asp:Label>
            </div>
            <div style="text-align: right">
                <asp:LinkButton runat="server" ID="lblBack" PostBackUrl="~/Default.aspx">Voltar</asp:LinkButton>
            </div>
        </div>
        <hr class="hr1" />
        <div class="alinhamentoDireita" style="margin-bottom: 9px;">
            <div class="buttonCollor">
                <asp:Button runat="server" ID="btnAddNewMedida" CssClass="buttonStyles" OnClick="btnAddNewMedida_Click" />

            </div>
        </div>
        <asp:UpdatePanel ID="upGrid" runat="server">
            <ContentTemplate>
                <div class="divGridCenter">
                    <asp:GridView ID="gvMedida" runat="server" AutoGenerateColumns="false" OnRowDataBound="gvMedida_RowDataBound"
                        OnPageIndexChanging="gvMedida_PageIndexChanging" AllowPaging="true" PageSize="10" DataKeyNames="COD_MEDIDA"
                        OnRowCreated="gvMedida_RowCreated">
                        <HeaderStyle BackColor="#c9c9c9" Font-Bold="true" ForeColor="#000" CssClass="gridViewHead" />
                        <RowStyle BackColor="#FFFFFF" CssClass="gridViewField" />
                        <AlternatingRowStyle BackColor="#DCDCDC" />
                        <PagerStyle CssClass="gridViewField" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Medida
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblMedida" Text='<%# Eval("MEDIDA") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="200px" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Status
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblStatus" Text='<%# Eval("STATUS") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="70px" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Alterar
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ID="lnkAlterar" CommandArgument='<%# String.Format("{0};{1};{2}", Eval("COD_MEDIDA"), Eval("MEDIDA"), Eval("STATUS")) %>'
                                        OnCommand="lnkAlterar_Click">Editar</asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle Width="100px" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Habilitar/Desabilitar
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ID="lnkEnableDisable" CommandArgument='<%# String.Format("{0};{1};{2}", Eval("COD_MEDIDA"), Eval("STATUS"), Eval("MEDIDA")) %>'
                                        OnCommand="lnkEnableDisable_Command"></asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle Width="140px" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Log
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ID="lnkLog" CommandArgument='<%# String.Format("{0}", Eval("COD_MEDIDA")) %>'
                                        OnCommand="lnkLog_Click">log</asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle Width="100px" />
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataRowStyle CssClass="msgEmptyList" />
                        <EmptyDataTemplate>
                            Dados não encontrados
                        </EmptyDataTemplate>
                    </asp:GridView>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
